// egret 数据
declare var global: any
class StageData {
    public static W:number;
    public static H:number;
    public static MainObj:Main;
    public static GameRoot:GameStage;//游戏场景

    public static serverAddress:string//游戏服务器地址//"ws://10.10.10.107:18092/nadsocket"
	public static chatserverAddress:string;//聊天服务器地址

    public static FXOBJ:JSSDK;//保存分享对象
    public static requestHead:string ="http";//请求头
	public static JSSDKStr:string;
	public static linkStr:string;
	public static bgMusicURL;
    public static JSSDKSound:Boolean = false;//微信授权后执行
    public static soundObj:soundPlay;//声音对象
    public static soundClose:boolean = true;//音效关闭
    public static bgMusicClose:boolean = true;//背景音乐关闭
    //游戏大厅链接
    public static gameHallLink:string;
    //游戏战绩链接http://lefantian.jiahuagame.com/game-lobby/login/weiXin/0
    public static recordLink:string;
    public static tt:number;

	//JSSDKStr: http://c-c.jiahuagame.com
	//线上域名 "http://lefantian.jiahuagame.com ://lefantian.jiahuagame.com
	//本地域名 "http://10.10.10.107:8080
    public static init(){
        const onHttps = window.location.href.match(/https/)
        if (window.location.hostname.match(/10.10.10/)) {
			StageData.JSSDKStr = 'http://10.10.10.107:8080'
		} else if (global.hostName) {
          StageData.JSSDKStr = global.hostName()
        // config.pre = 'https://lefantian-s.jiahuagame.com/game-lobby'
        } else if (window.location.hostname.match(/lefantian/)) {
			StageData.JSSDKStr = onHttps ? 'https://lefantian.jiahuagame.com' : 'http://lefantian.jiahuagame.com'
		} else {
			StageData.JSSDKStr = onHttps ? 'https://c-c.jiahuagame.com' : 'http://c-c.jiahuagame.com'
		}
        // StageData.JSSDKStr = StageData.requestHead+"://c-c.jiahuagame.com";
        // StageData.JSSDKStr = StageData.requestHead+"://10.10.10.107:8080";     
        // StageData.JSSDKStr = StageData.requestHead+"://lefantian.jiahuagame.com";         
        StageData.linkStr = StageData.JSSDKStr+"/game-lobby";
        StageData.bgMusicURL = StageData.JSSDKStr+"/hongzhong/bgmusic.mp3";
    }

    public static get HTTP_URL():string{
        return StageData.linkStr+"/game/disp/"+GameData.areaCode+"/"+new Date().getTime();
    }
    public static get updateLink():string{
        return this.gameHallLink;
    }
    public static get toRecordLink():string{
       let url:string = this.recordLink+"?areaCode="+GameData.areaCode+"&token="+GameData.token+"&gameNo="+GameData.gameNo+"&gameType=3";
       return url;
    }
}

/*
userList":
[{"actionList":[{"actionCard":{"cardIndex":17,"count":7,"suitType":"S"},"actionCode":2,"actionIndex":1,"actionType":"PENG"}],"allow":true,"auto":false,"canDoActions":[],"continueReady":true,"handCount":11,"headUrl":"http://wx.qlogo.cn/mmopen/vi_32/6ay6OtX1r4lRcLfJUibkhFgib2DnAnwSsAIg2VX8DT5DoTJzlo3cchWlSj0pMuicrzzfS4fFxJEEatrfgkfErAYwQ/0","lftid":100034,"nickname":"A静静","offline":false,"pointVo":{"bankerCount":0,"betPoint":0,"originalPoint":0,"presentPoint":0,"suitPatternHistory":[],"suitPatternHistoryDescribe":[]},"ready":true,"readyList":[],"seatIndex":2,"showList":[],"token":"966c5b0953794c5daa7c97a462dc3988","uid":"oFHhKw8lV3oWRPF27Rf--p-jy7Zw"},
{"actionList":[{"actionCard":{"cardIndex":21,"count":1,"suitType":"T"},"actionCode":2,"actionIndex":2,"actionType":"PENG"}],"allow":true,"auto":false,"canDoActions":[],"continueReady":true,"handCount":10,"headUrl":"http://wx.qlogo.cn/mmopen/vi_32/TmkcfRj9Jz1mVpalA5AjDrIftpkxPoUzwJ4jKjZgL7t6YhRrUY2iaDGLe71uAEH9fEtSwFWuXCUTRfvwVYxgP2Q/0","lftid":100102,"nickname":"薄荷红茶","offline":false,"pointVo":{"bankerCount":0,"betPoint":0,"originalPoint":0,"presentPoint":0,"suitPatternHistory":[],"suitPatternHistoryDescribe":[]},"ready":true,"readyList":[{"cardIndex":31,"count":-1,"suitType":"Z"},{"cardIndex":16,"count":6,"suitType":"S"},{"cardIndex":12,"count":2,"suitType":"S"}],"seatIndex":1,"showList":[{"cardIndex":15,"count":5,"suitType":"S"}],"token":"dca76ac51a0e487e8d32a413f785091d","uid":"oFHhKw-ecKPj6dRW6MEU84dn2aPo"},
{"actionList":[],"allow":true,"auto":false,"canDoActions":[],"continueReady":true,"handCount":13,"handList":[{"cardIndex":22,"count":2,"suitType":"T"},{"cardIndex":13,"count":3,"suitType":"S"},{"cardIndex":3,"count":3,"suitType":"W"},{"cardIndex":14,"count":4,"suitType":"S"},{"cardIndex":5,"count":5,"suitType":"W"},{"cardIndex":15,"count":5,"suitType":"S"},{"cardIndex":6,"count":6,"suitType":"W"},{"cardIndex":6,"count":6,"suitType":"W"},{"cardIndex":26,"count":6,"suitType":"T"},{"cardIndex":7,"count":7,"suitType":"W"},{"cardIndex":7,"count":7,"suitType":"W"},{"cardIndex":8,"count":8,"suitType":"W"},{"cardIndex":9,"count":9,"suitType":"W"}],"headUrl":"http://wx.qlogo.cn/mmopen/vi_32/xFmJqHNJCdxRiceu044EIJJ2SBgjyIN0MqLnfOEmOMsjcfwpzHZBHpibdSliarlzMxEtKiaqicL5gSMibxkV3Wwg2ZdQ/0","lftid":100011,"nickname":"刘伟","offline":false,"pointVo":{"bankerCount":0,"betPoint":0,"originalPoint":0,"presentPoint":0,"suitPatternHistory":[],"suitPatternHistoryDescribe":[]},"ready":true,"readyList":[],"seatIndex":0,"showList":[{"cardIndex":11,"count":1,"suitType":"S"}],"token":"bfaa43f3e75d4f2ead03288f2b4b5ec9","uid":"oFHhKw1JiRyouKsyO4q_YjNS-pr0"}]
*/